const Joi = require("joi");

const id = Joi.number().integer().min(1).required();
const title = Joi.string().min(1).max(50).required();
const content = Joi.string().min(30).required();

// 根据专业类别查询所有文章
exports.getArticleByCateSchema = {
  params: {
    id,
  },
};

// 根据文章 ID 获取文章信息
exports.getArticleByIdSchema = {
  params: {
    id,
  },
};

// 修改
exports.updateArticleSchema = {
  body: {
    articleId: id,
    majorId: id,
    title,
    content,
  },
};

// 新增
exports.addArticleSchema = {
  body: {
    majorId: id,
    title,
    content,
  },
};

// 删除
exports.deleteArticleSchema = {
  params: {
    id,
  },
};
